package jpa.entitys.promis.common;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the CUST_CRNOTE_INVOICE_REFERENCES database table.
 * 
 */
@Embeddable
public class CustCrnoteInvoiceReferencePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(unique=true, nullable=false, length=2)
	private String company;

	@Column(name="CREDIT_NOTE_TYPE", unique=true, nullable=false, length=2)
	private String creditNoteType;

	@Column(name="CREDIT_NOTE_SERIES", unique=true, nullable=false, length=4)
	private String creditNoteSeries;

	@Column(name="CREDIT_NOTE_NO", unique=true, nullable=false, precision=6)
	private long creditNoteNo;

	@Column(name="CREDIT_NOTE_SEQ", unique=true, nullable=false, precision=6)
	private long creditNoteSeq;

    public CustCrnoteInvoiceReferencePK() {
    }
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getCreditNoteType() {
		return this.creditNoteType;
	}
	public void setCreditNoteType(String creditNoteType) {
		this.creditNoteType = creditNoteType;
	}
	public String getCreditNoteSeries() {
		return this.creditNoteSeries;
	}
	public void setCreditNoteSeries(String creditNoteSeries) {
		this.creditNoteSeries = creditNoteSeries;
	}
	public long getCreditNoteNo() {
		return this.creditNoteNo;
	}
	public void setCreditNoteNo(long creditNoteNo) {
		this.creditNoteNo = creditNoteNo;
	}
	public long getCreditNoteSeq() {
		return this.creditNoteSeq;
	}
	public void setCreditNoteSeq(long creditNoteSeq) {
		this.creditNoteSeq = creditNoteSeq;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CustCrnoteInvoiceReferencePK)) {
			return false;
		}
		CustCrnoteInvoiceReferencePK castOther = (CustCrnoteInvoiceReferencePK)other;
		return 
			this.company.equals(castOther.company)
			&& this.creditNoteType.equals(castOther.creditNoteType)
			&& this.creditNoteSeries.equals(castOther.creditNoteSeries)
			&& (this.creditNoteNo == castOther.creditNoteNo)
			&& (this.creditNoteSeq == castOther.creditNoteSeq);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.creditNoteType.hashCode();
		hash = hash * prime + this.creditNoteSeries.hashCode();
		hash = hash * prime + ((int) (this.creditNoteNo ^ (this.creditNoteNo >>> 32)));
		hash = hash * prime + ((int) (this.creditNoteSeq ^ (this.creditNoteSeq >>> 32)));
		
		return hash;
    }
}